/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package linkedlistdependentstack;

/**
 *
 * @author mweya
 */
public class Node<AnyType> {
    private Node next = null;
    private Node prev = null;
    private AnyType data = null;
    
    public Node() {
    
    }
    
    public Node(AnyType data) {
        this.data = data;
    }
    
    public Node(AnyType data, Node prev, Node next) {
        this.data = data;
        this.prev = prev;
        this.next = next;
    }
    
    public void setData(AnyType data) {
        this.data = data;
    }
    
    public void setPrev(Node prev) {
        this.prev = prev;
    }
    
    public void setNext(Node next) {
        this.next = next;
    }
    
    public AnyType getData() {
        return (AnyType) data;
    }
    
    public Node getNext() {
        return this.next;
    }
    
    public Node getPrev() {
        return this.prev;
    }
    
    public String toString() {
        return "Node=(<"+this.prev+", "+this.data+", "+this.next+">)";
    }
}